package translated;

import java.util.List;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.jet.util.*;

public class StartUpGen
{
  protected static String nl;
  public static synchronized StartUpGen create(String lineSeparator)
  {
    nl = lineSeparator;
    StartUpGen result = new StartUpGen();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "/**" + NL + " * Copyright (c) Software Institute of PKU" + NL + " * All rights reserved. " + NL + " * This program and the accompanying materials" + NL + " * are made available under the terms of the Eclipse Public License v1.0" + NL + " * which accompanies this distribution, and is available at" + NL + " * http://www.eclipse.org/legal/epl-v10.html" + NL + " *" + NL + " */" + NL + "package ";
  protected final String TEXT_2 = ";" + NL + "" + NL + "import org.eclipse.ui.IStartup;" + NL + "import org.eclipse.ui.IViewPart;" + NL + "import org.eclipse.ui.IWorkbenchWindow;" + NL + "import org.eclipse.ui.PlatformUI;" + NL + "" + NL + "import edu.pku.sei.modeler.actions.ActionRegistry;" + NL + "import edu.pku.sei.modeler.explorer.MetaModelView;" + NL + "import edu.pku.sei.modeler.project.ProjectRegistry;" + NL + "import ";
  protected final String TEXT_3 = ";" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " *" + NL + " */" + NL + "public class ";
  protected final String TEXT_4 = " implements IStartup {" + NL + "" + NL + "\t/* (non-Javadoc)" + NL + "\t * @see org.eclipse.ui.IStartup#earlyStartup()" + NL + "\t */" + NL + "\tpublic void earlyStartup() {" + NL + "\t\tSystem.out.println(\"generated bundle started\");" + NL + "\t\t";
  protected final String TEXT_5 = " factory = new ";
  protected final String TEXT_6 = "();" + NL + "\t\tProjectRegistry.getDefault().addProjFactory(factory);" + NL + "\t\tActionRegistry.getDefault().addActionFactory(new ";
  protected final String TEXT_7 = "());" + NL + "\t}" + NL + "" + NL + "}";
  protected final String TEXT_8 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    stringBuffer.append(ModelerConstants.pkgBase + "." + ModelerConstants.internalBase);
    stringBuffer.append(TEXT_2);
    stringBuffer.append(ModelerConstants.pkgBase + "." + ModelerConstants.actionBase + "." + ModelerConstants.actionPrivider);
    stringBuffer.append(TEXT_3);
    stringBuffer.append(ModelerConstants.starupName);
    stringBuffer.append(TEXT_4);
    stringBuffer.append(ModelerConstants.projFactory);
    stringBuffer.append(TEXT_5);
    stringBuffer.append(ModelerConstants.projFactory);
    stringBuffer.append(TEXT_6);
    stringBuffer.append(ModelerConstants.actionPrivider);
    stringBuffer.append(TEXT_7);
    stringBuffer.append(TEXT_8);
    return stringBuffer.toString();
  }
}
